<template>
  <div>
    <div>
      <div
          style="position: absolute; left: 0px; font-size: 30px; font-weight: 400; color: white; font-family: 'times new roman'">
        campus &nbsp;<span style="font-size: 12px;"> &nbsp; copyctrl®</span></div>
      <div style="float:right" v-show="login">
        <el-link  style="margin-bottom: 20px;margin-left: 10px" type="warning" @click="logout">退出登录</el-link>
      </div>
    </div>
  </div>
</template>

<script>
import {mapState,mapActions} from 'vuex'
export default {
  name: "Header",
  computed:{
    ...mapState('userOptions',['login']),
  },
  methods:{
    ...mapActions('userOptions',{update:'updateLogin',user:'updateUser'}),
    logout(){
      this.update(false)
      this.user(null)
      this.$router.push("/welcome").catch(err => err)
    }
  }
}
</script>

<style scoped>

</style>
